Skip to content

Fix touchpad pan gesture suppressed when editing masks#21490

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
da-phil:fix_pan_gesture_when_editing_masks
Jul 7, 2026
Merged

Fix touchpad pan gesture suppressed when editing masks#21490
TurboGit merged 1 commit into
darktable-org:masterfrom
da-phil:fix_pan_gesture_when_editing_masks

Conversation

@da-phil

@da-phil da-phil commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

A two-finger scroll (no CTRL) fell through to zoom whenever a mask overlay was visible, even with the pointer off the mask. gesture_pan now declines the pan only when the scroll would actually be consumed by the mask (pointer over a shape, or creating a size-adjustable shape) via the new dt_masks_scroll_over_mask() predicate. Elsewhere on the canvas, and while drawing a path (which has no scroll-adjustable parameter during creation), the scroll pans the image as expected.

Here is the updated behavior overview:

  ┌─────────────────────────────┬────────────────────┬──────────────────────────┐
  │           Gesture           │ Cursor inside mask │   Cursor outside mask    │
  ├─────────────────────────────┼────────────────────┼──────────────────────────┤
  │ Two-finger scroll (no Ctrl) │ resize mask        │ pan   (was zoom)         │
  ├─────────────────────────────┼────────────────────┼──────────────────────────┤
  │ Ctrl + two-finger scroll    │ opacity            │ zoom  (matches mouse)    │
  ├─────────────────────────────┼────────────────────┼──────────────────────────┤
  │ Pinch                       │ zoom               │ zoom                     │
  └─────────────────────────────┴────────────────────┴──────────────────────────┘

  ┌────────────────────────────────────────┬──────────────────────────────────────────┐
  │                 State                  │       Two-finger scroll (no Ctrl)        │
  ├────────────────────────────────────────┼──────────────────────────────────────────┤
  │ Drawing a path                         │ pan (was zoom)                           │
  ├────────────────────────────────────────┼──────────────────────────────────────────┤
  │ Creating circle/ellipse/gradient/brush │ adjust default size/border (unchanged)   │
  ├────────────────────────────────────────┼──────────────────────────────────────────┤
  │ Pointer over an existing shape         │ resize                                   │
  ├────────────────────────────────────────┼──────────────────────────────────────────┤
  │ Pointer off the mask                   │ pan                                      │
  └────────────────────────────────────────┴──────────────────────────────────────────┘

Disclaimer: this work has been co-created with Claude.

A two-finger scroll (no CTRL) fell through to zoom whenever a mask
overlay was visible, even with the pointer off the mask. gesture_pan
now declines the pan only when the scroll would actually be consumed
by the mask (pointer over a shape, or creating a size-adjustable
shape) via the new dt_masks_scroll_over_mask() predicate. Elsewhere
on the canvas, and while drawing a path (which has no scroll-adjustable
parameter during creation), the scroll pans the image as expected.
@da-phil

da-phil commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

@TurboGit I think this one qualifies for a 5.6.1, given that touchpad gestures were (properly) introduced in that release.

@da-phil da-phil marked this pull request as ready for review July 4, 2026 20:13
@TurboGit TurboGit added this to the 5.6.1 milestone Jul 4, 2026
@TurboGit TurboGit added bugfix pull request fixing a bug priority: medium core features are degraded in a way that is still mostly usable, software stutters scope: codebase making darktable source code easier to manage release notes: pending labels Jul 4, 2026
@ralfbrown

Copy link
Copy Markdown
Collaborator

Does this code correctly result in zooming while holding down the 'a' key even when the pointer is over a shape?

@da-phil

da-phil commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Does this code correctly result in zooming while holding down the 'a' key even when the pointer is over a shape?

It does, with mouse wheel scroll gesture. On the touchpad the pointer is freezing as soon as "a" is pressed and all touchpad gestures ignored. It this how it should behave? I wasn't even aware of this alternative behavior using the "a" key.

@da-phil

da-phil commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@TurboGit where do you want me to put release notes? RELEASE_NOTES.md seems to be already prepared for 5.8.0.

@TurboGit

TurboGit commented Jul 6, 2026

Copy link
Copy Markdown
Member

In RELEASE_NOTES.md in branch darktable-5.6.x. You can create a PR targeting this branch or just paste the text here and I'll merge.

@da-phil

da-phil commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Ah, so I'll just target develop and you're going to cherry-pick it onto the darktable-5.6.x branch? Or do you prefer a different workflow. I'm happy to do the cherry-picking and adding the respective release notes to take off some load on your shoulders, if that helps.
Sorry for my ignorance, I've not yet found the info on how things are done to support patch releases.

@TurboGit

TurboGit commented Jul 6, 2026

Copy link
Copy Markdown
Member

No, you cannot target develop (master) because RELEASES_NOTES.md there is for 5.8 as you noted.

You need to create a specific PR with the release note entry targeting darktable-5.6.x directly.

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, thanks!

@TurboGit TurboGit merged commit a0c0372 into darktable-org:master Jul 7, 2026
5 checks passed
@da-phil da-phil deleted the fix_pan_gesture_when_editing_masks branch July 7, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug priority: medium core features are degraded in a way that is still mostly usable, software stutters release notes: pending scope: codebase making darktable source code easier to manage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants